
//  DispathcQueue+Once.swift
//  mmda
//
//  Created by 李陆涛 on 2018/4/19.
//  Copyright © 2018年 mmda. All rights reserved.
//

import Foundation

extension DispatchQueue {
    
//    private static var _onceTracker = [String]()
//    public class func once(token: String, block: () -> ()) {
//        
//        objc_sync_enter(self)
//        defer {
//            objc_sync_exit(self)
//        }
//        if _onceTracker.contains(token) {
//            return
//        }
//        _onceTracker.append(token)
//        block()
//    }
    
    func async(block: @escaping ()->()) {
        
        self.async(execute: block)
    }
    
    func after(_ delay: TimeInterval, block: @escaping ()->()) {
        
        self.asyncAfter(deadline: .now() + delay, execute: block)
    }
}
